package com.example.payserver1040.controller;

import com.example.payserver1040.feignclient.UserFeignClient;
import com.example.springcloudusercommon.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 温伟雄
 * @Date: 2021/10/12/19:05
 * @Description:
 */
@RestController
public class PayController {
    @Autowired
    private UserFeignClient userFeignClient;

    //浏览器来调用
    @RequestMapping("/pay/{id}")
    public User getById(@PathVariable("id")Long id){
        //使用Feign调用用户服务获取User
        return userFeignClient.getById(id);
    }
}
